package com.gdut.thread;

public class MyRunnable implements Runnable{

    @Override
    public void run() {

        if (Thread.currentThread().getName().equals("tank")) {
            for (int i = 0; i < 50; i++) {
                System.out.println(Thread.currentThread().getName() + "你好" + i);
                Thread.yield();
            }
        }else {
            for (int i = 0; i < 50; i++) {
                System.out.println(Thread.currentThread().getName() + "你好a" + i);
                Thread.yield();
            }
        }
    }
}
